<script setup>
import { watchEffect } from 'vue'

const { foo } = defineProps(['foo'])

watchEffect(() => {
  console.log(foo)
})

</script>

<template>
  <div>
    <h2>我是子组件</h2>
    <p>收到的 foo: {{ foo }}</p>
  </div>
</template>